package cn.crc.web.usertask;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 线程池来处理定时任务...测试无效...25.5.22
 * 1.使用@EnableScheduling + @Configuration配置ThreadPoolTaskScheduler
 * 2.使用ThreadPoolTaskExecutor
 */
//@Component
//@EnableScheduling
public class TaskDataTest {

    @Scheduled(cron = "0/10 * * * * ?")
    public void startMoveTest() throws InterruptedException {
        long delay= 5000;
        String time1= DateUtil.format(DateUtil.date(), DatePattern.NORM_DATETIME_FORMAT);
        for(int i=0;i<4;i++){
            System.out.println(time1+"\t"+DateUtil.format(DateUtil.date(), DatePattern.NORM_DATETIME_FORMAT) );
            Thread.sleep(delay);
        }
    }

}
